package com.entrogy.dao;

import com.entrogy.bean.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * @ClassName MaintenanceMapper
 * @Description
 * @Author luoxingjiang
 * @Date 2019-12-11 上午 11:22
 * @Version 1.0
 **/
@Repository
public interface MaintenanceMapper {

    /**
     * 获取学校基础信息
     * @param schoolCode
     * @return
     */
    MaintenanceSchoolEntity getSchoolInfo(@Param("schoolCode") Integer schoolCode);

    /**
     * 查询信息发送条数
     * @param schoolCode
     * @param startDate
     * @param endDate
     * @return
     */
    Integer countMessageSend(@Param("schoolCode") Integer schoolCode, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

    /**
     * 查询某段时间内哪些人收到消息
     * @param schoolCode
     * @param startDate
     * @param endDate
     * @return
     */
    Integer countReceivedMessage(@Param("schoolCode") Integer schoolCode, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

    /**
     * 查询某段时间发送了多少条短信消息
     * @param schoolCode
     * @param startDate
     * @param endDate
     * @return
     */
    Integer countShortMessageSend(@Param("schoolCode") Integer schoolCode, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

    /**
     * 查询某段时间发送了多少次作业
     * @param schoolCode
     * @param startDate
     * @param endDate
     * @return
     */
    Integer countHomeworkSend(@Param("schoolCode") Integer schoolCode, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

    /**
     * 查询某段时间有多少家长接收到作业信息
     * @param schoolCode
     * @param startDate
     * @param endDate
     * @return
     */
    Integer countHomeworkReceived(@Param("schoolCode") Integer schoolCode, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

    /**
     * 统计请假次数
     * @param schoolCode
     * @param startDate
     * @param endDate
     * @return
     */
    Integer countAskForLeaveUse(@Param("schoolCode") Integer schoolCode, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

    /**
     * 统计进校申请次数
     * @param schoolCode
     * @param startDate
     * @param endDate
     * @return
     */
    Integer countApplyVisitUse(@Param("schoolCode") Integer schoolCode, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

    /**
     * 统计教师关注情况
     * @param schoolCode
     * @param startDate
     * @param endDate
     * @return
     */
    List<MaintenanceFocusEntity> listTeacherFocusInfo(@Param("schoolCode") Integer schoolCode, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

    /**
     * 统计家长关注情况
     * @param schoolCode
     * @param startDate
     * @param endDate
     * @return
     */
    List<MaintenanceFocusEntity> listParentFocusInfo(@Param("schoolCode") Integer schoolCode, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

    /**
     * 统计教师登录情况
     * @param schoolCode
     * @param startDate
     * @param endDate
     * @return
     */
    List<MaintenanceLoginEntity> listTeacherLoginInfo(@Param("schoolCode") Integer schoolCode, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

    /**
     * 统计家长登录情况
     * @param schoolCode
     * @param startDate
     * @param endDate
     * @return
     */
    List<MaintenanceLoginEntity> listParentLoginInfo(@Param("schoolCode") Integer schoolCode, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

    /**
     * 统计教师注册情况
     * @param schoolCode
     * @param startDate
     * @param endDate
     * @return
     */
    List<MaintenanceRegisterEntity> listTeacherRegisterInfo(@Param("schoolCode") Integer schoolCode, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

    /**
     * 统计家长注册情况
     * @param schoolCode
     * @param startDate
     * @param endDate
     * @return
     */
    List<MaintenanceRegisterEntity> listParentRegisterInfo(@Param("schoolCode") Integer schoolCode, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

    /**
     * 查询家长
     * @param schoolCode
     * @param parentPhone
     * @param parentName
     * @return
     */
    List<MaintenanceParentEntity> listParent(@Param("schoolCode") Integer schoolCode, @Param("parentPhone") String parentPhone, @Param("parentName") String parentName);

    /**
     * 查询学校已发信息
     * @param schoolCode
     * @return
     */
    List<MaintenanceMessageEntity> listSchoolMessage(Integer schoolCode);

    /**
     * 查询学校家长注册率
     * @param schoolCode
     * @return
     */
    Double getParentLoginRate(@Param("schoolCode") Integer schoolCode);
}
